package com.credit.service;

import java.util.List;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import com.credit.entity.CreditLoanLog;
import com.credit.entity.CreditLoanOrder;
import com.credit.repository.CreditLoanLogDao;

@Service("creditLoanLogService")
@Transactional
public class CreditLoanLogService {

	@Autowired
	private CreditLoanLogDao creditLoanLogDao;
	
	public CreditLoanLog getLoanLogByLoanId(int loanId) {
		
		return creditLoanLogDao.findByLoanId(loanId);
	}

	public void addLoanLog(CreditLoanLog loanLog) {
		
		creditLoanLogDao.save(loanLog);
		
	}

	public List<CreditLoanLog> findLoanLogByLoanIdAndUid(Long loanId, Long userId,int appType) {
		
		return creditLoanLogDao.findLoanLogByLoanIdAndUid(loanId,userId,appType);
	}

	public void updateLoanLog(CreditLoanLog creditLoanLog) {
		
		creditLoanLogDao.save(creditLoanLog);
		
	}

	public CreditLoanLog findLoanLogByLoanIdAndUid(Long loanId, Long userId, Integer processFlag,Integer processStatus,int appType) {
		
		return creditLoanLogDao.findLoanLogByLoanIdAndUid(loanId,userId,processFlag,processStatus,appType);
	}




}
